﻿using Assets.Scripts.Extensions;
using UnityEngine;

namespace Assets.Scripts.App
{
    public class ObjectPoolComp : MonoBehaviour
    {
        public static ObjectPoolComp Get { get; private set; }
        public GameObjectPool ObjectPool { get; private set; }
        protected Transform Work{ get; private set; }
        protected Transform Idle { get; private set; }
        private void Awake()
        {
            Get = this;
            if (Work == null)
                Work = UtilExtensions.Create(transform, "work");
            if (Idle == null)
                Idle = UtilExtensions.Create(transform, "idle");

            ObjectPool = new GameObjectPool(Work, Idle);
        }
    }
}
